package org.jackysoft.interceptor;

import java.lang.reflect.Method;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jackysoft.annotations.ActionRequestMethod;
import org.jackysoft.annotations.MethodInceptor;
import org.springframework.web.servlet.ModelAndView;

@MethodInceptor(method = ActionRequestMethod.gets)
public class GetsInterceptor extends AbstractInterceptor {

	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {

		Method service_m_gets = service.getClass().getMethod("gets");
		// 从数据库查询得到的对象
		Object beans = service_m_gets.invoke(service);

		modelAndView.addObject("beans", beans);

	}
}
